<!--#include("header.html")-->
<script type="text/javascript">
xe.lang.msg_empty_search_target = '{$lang->msg_empty_search_target}';
xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
</script>
<load target="js/comment_admin.js" usecdn="true" />
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
	<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form id="fo_list" action="./" method="post" class="form">
	<h1 class="h1">{$lang->comment}</h1>
	<div class="table even">
		<div class="cnb">
			<a href="{getUrl('search_keyword','','act','dispCommentAdminList', 'Y')}" <!--@if($search_keyword == '')-->class="active"<!--@end-->>{$lang->all}</a>
			| <a href="{getUrl('search_target','is_secret','search_keyword', 'N')}" <!--@if($search_target == 'is_secret' && $search_keyword == 'N')-->class="active"<!--@end-->>{$secret_name_list['N']}</a>
			| <a href="{getUrl('search_target','is_secret','search_keyword', 'Y')}" <!--@if($search_target == 'is_secret' && $search_keyword == 'Y')-->class="active"<!--@end-->>{$secret_name_list['Y']}</a>
			| <a href="{getUrl('search_target','is_published','search_keyword', 'N')}" <!--@if($search_target == 'is_published' && $search_keyword == 'N')-->class="active"<!--@end-->>{$lang->published_name_list['N']}</a>
			| <a href="{getUrl('search_target','is_published','search_keyword', 'Y')}" <!--@if($search_target == 'is_published' && $search_keyword == 'Y')-->class="active"<!--@end-->>{$lang->published_name_list['Y']}</a>

			<block cond="$modules_list">
			| <label for="comment_modules" <!--@if($search_target == 'module')-->class="active"<!--@end-->>{$lang->select_module}:
			<select id="comment_modules" name="comment_modules" onchange="location.href='{getUrl('search_target','module','search_keyword','')}&amp;search_keyword='+this.value">
				<option></option>
				<!--@foreach($modules_list as $key => $node)-->
				<option value="{$key}"<!--@if($key==$search_keyword)-->selected<!--@end-->>{$node}</option>
				<!--@end-->
			</select></label>
			</block>
		</div>
		<table width="100%" border="1" cellspacing="0" id="commentListTable">
			<caption>
				<!--@if($search_keyword == '')-->
				{$lang->all}
				<!--@elseif($search_target == 'is_secret' && $search_keyword == 'N')-->
				{$secret_name_list['N']}
				<!--@elseif($search_target == 'is_secret' && $search_keyword == 'Y')-->
				{$secret_name_list['Y']}
				<!--@elseif($search_target == 'is_published' && $search_keyword == 'N')-->
				{$published_name_list['N']}
				<!--@elseif($search_target == 'is_published' && $search_keyword == 'Y')-->
				{$published_name_list['Y']}
				<!--@end-->
				({number_format($total_count)})
				<div class="side">
					<span class="btn"><a href="#listManager" class="modalAnchor" onclick="getCommentList();">{$lang->comment_manager}...</a></span>
				</div>
			</caption>
			<thead>
				<tr>
					<th scope="col" class="text">{$lang->comment}</th>
					<th scope="col" class="nowr">{$lang->writer}</th>
					<th scope="col" class="nowr">{$lang->cmd_vote}(+/-)</th>
					<th scope="col" class="nowr">{$lang->date}</th>
					<th scope="col" class="nowr">{$lang->ipaddress}</th>
					<th scope="col" class="nowr">{$lang->status}</th>
					<th scope="col">{$lang->published}</th>
					<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<th scope="col" class="text">{$lang->comment}</th>
					<th scope="col" class="nowr">{$lang->writer}</th>
					<th scope="col" class="nowr">{$lang->cmd_vote}(+/-)</th>
					<th scope="col" class="nowr">{$lang->date}</th>
					<th scope="col" class="nowr">{$lang->ipaddress}</th>
					<th scope="col" class="nowr">{$lang->status}</th>
					<th scope="col">{$lang->published}</th>
					<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>
				</tr>
			</tfoot>
			<tbody>
				<!--@foreach($comment_list as $no => $val)-->
				{@ $comment = cut_str(trim(strip_tags($val->content)), 200, '...')}
				<tr>
					<td class="text"><a href="{getUrl('','document_srl',$val->document_srl)}#comment_{$val->comment_srl}" target="_blank"><!--@if(strlen($comment))-->{$comment}<!--@else--><em>{$lang->no_text_comment}</em><!--@end--></a></td>
					<td class="nowr"><a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->nick_name}</a></td>
					<td class="nowr">{number_format($val->get('voted_count'))}/{number_format($val->get('blamed_count'))}</td>
					<td class="nowr">{(zdate($val->regdate,"Y-m-d\nH:i:s"))}</td>
					<td class="nowr"><a href="{getUrl('search_target','ipaddress','search_keyword',$val->ipaddress)}">{$val->ipaddress}</a></td>
					<td class="nowr"><!--@if($val->isSecret())-->{$secret_name_list['Y']}<!--@else-->{$secret_name_list['N']}<!--@end--></td>
					<td class="nowr"><!--@if($val->status)-->{$lang->published_name_list['Y']}<!--@else-->{$lang->published_name_list['N']}<!--@end--></td>
					<td><input type="checkbox" name="cart" value="{$val->comment_srl}" /></td>
				</tr>
				<!--@end-->
			</tbody>
		</table>
		<div class="btnArea">
			<span class="btn"><a href="#listManager" class="modalAnchor" onclick="getCommentList();">{$lang->comment_manager}...</a></span>
		</div>
	</div>
</form>
<div class="modal" id="listManager">
	<form ruleset="deleteChecked" action="./" method="post" class="fg form">
	<input type="hidden" name="module" value="comment" />
	<input type="hidden" name="act" value="procCommentAdminDeleteChecked" />
	<input type="hidden" name="page" value="{$page}" />
	<input type="hidden" name="is_trash" value="false" />
	<input type="hidden" name="will_publish" value="0" />
	<input type="hidden" name="search_target" value="{$search_target}" />
	<input type="hidden" name="search_keyword" value="{$search_keyword}" />
		<h2 class="h2">{$lang->comment_manager}</h2>
		<div class="table even">
			<table width="100%" border="1" cellspacing="0" id="commentManageListTable">
				<caption>
				{$lang->selected_comment} <strong id="selectedCommentCount"></strong>
				</caption>
				<thead>
					<tr>
						<th scope="col" class="title">{$lang->comment}</th>
						<th scope="col" class="nowr">{$lang->writer}</th>
						<th scope="col" class="nowr">{$lang->status}</th>
						<th scope="col">{$lang->published}</th>
					</tr>
				</thead>
				<tbody>
				</tbody>
			</table>
		</div>
		<p class="q"><label for="message">{$lang->message_notice}</label></p>
		<p>
			<textarea rows="8" cols="42" name="message_content" id="message" style="width:98%"></textarea>
		</p>
		<div class="btnArea">
			<!--@if ($search_target=='is_published' && $search_keyword=="N")-->
				<span class="btn"><button type="submit" name="will_publish" value="1" onclick="doChangePublishedStatus(this.value);">{$lang->cmd_publish}</button></span>
			<!--@elseif ($search_target=='is_published' && $search_keyword=="Y")-->
				<span class="btn"><button type="submit" name="will_publish" value="0" onclick="doChangePublishedStatus(this.value);">{$lang->cmd_unpublish}</button></span>
			<!--@else-->
				<span class="btn"><button type="submit" name="will_publish" value="1" onclick="doChangePublishedStatus(this.value);">{$lang->cmd_publish}</button></span>
				<span class="btn"><button type="submit" name="will_publish" value="0" onclick="doChangePublishedStatus(this.value);">{$lang->cmd_unpublish}</button></span>
			<!--@end-->
			<span class="btn"><button type="submit" name="is_trash" value="true">{$lang->cmd_trash}</button></span>
			<span class="btn"><button type="submit" name="is_trash" value="false">{$lang->cmd_delete}</button></span>
		</div>
	</form>
</div>
<div class="search">
<form action="./" class="pagination">
	<input type="hidden" name="error_return_url" value="" />
	<input type="hidden" name="module" value="{$module}" />
	<input type="hidden" name="act" value="{$act}" />
  	<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
  	<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />

	<a href="{getUrl('page', '')}" class="direction">&laquo; {$lang->first_page}</a>
	<block cond="$page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page && $page_navigation->page_count != $page_navigation->total_page">
		{@$isGoTo = true}
		<a href="{getUrl('page', '')}">1</a>
		<a href="#goTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
	</block>
	<!--@while($page_no = $page_navigation->getNextPage())-->
		{@$last_page = $page_no}
		<strong cond="$page_no == $page">{$page_no}</strong>
		<a cond="$page_no != $page" href="{getUrl('page', $page_no)}">{$page_no}</a>
	<!--@end-->
	<block cond="$last_page != $page_navigation->last_page">
		{@$isGoTo = true}
		<a href="#goTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
		<a href="{getUrl('page', $page_navigation->last_page)}">{$page_navigation->last_page}</a>
	</block>
	<a href="{getUrl('page', $page_navigation->last_page)}" class="direction">{$lang->last_page} &raquo;</a>
	<span cond="$isGoTo" id="goTo" class="tgContent">
		<input name="page" title="{$lang->cmd_go_to_page}" />
		<button type="submit">Go</button>
	</span>
</form>

	<form action="./" method="get" class="adminSearch" onsubmit="return checkSearch(this)">
	<input type="hidden" name="module" value="{$module}" />
	<input type="hidden" name="act" value="{$act}" />
	<input type="hidden" name="module_srl" value="{$module_srl}" />
	<input type="hidden" name="error_return_url" value="" />
		<select name="search_target">
			<option value="">{$lang->search_target}</option>
			<!--@foreach($lang->search_target_list as $key => $val)-->
			<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
			<!--@end-->
		</select>
		<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
		<input type="submit" value="{$lang->cmd_search}" />
		<a href="{getUrl('','module',$module,'act',$act)}">{$lang->cmd_cancel}</a>
	</form>
</div>
